package uutalk.netcloud.talk.store;


import net.orange_box.storebox.annotations.method.ClearMethod;
import net.orange_box.storebox.annotations.method.KeyByString;
import net.orange_box.storebox.annotations.method.RemoveMethod;
import net.orange_box.storebox.annotations.method.TypeAdapter;
import net.orange_box.storebox.annotations.type.FilePreferences;

import uutalk.netcloud.talk.model.bean.LoginInfo;
import uutalk.netcloud.talk.model.bean.UserInfo;


/**
 * Created by hujie on 16/6/19.
 */
@FilePreferences("login_userinfo")
public interface UserInfoPreference {

    String keyUserInfo = "userInfo";

    @KeyByString(keyUserInfo)
    @TypeAdapter(UserInfoTypeAdapter.class)
    UserInfo getUserInfo();

    @KeyByString(keyUserInfo)
    @TypeAdapter(UserInfoTypeAdapter.class)
    void setUserInfo(UserInfo userInfo);

    @KeyByString("login_info")
    @TypeAdapter(LoginInfoTypeAdapter.class)
    void setLoginInfo(LoginInfo LoginInfo);

    @KeyByString("login_info")
    @TypeAdapter(LoginInfoTypeAdapter.class)
    LoginInfo getLoginInfo();


    @KeyByString(keyUserInfo)
    @RemoveMethod
    void removeUserInfo();

    @KeyByString("login_info")
    @RemoveMethod
    void removeLoginInfo();


    @ClearMethod
    void clear();

}
